import { useEffect, useState } from "react";

// 商品分类编辑页面
import { callect_shopping } from "../../tools/api";

// 读取本次存储里面的用户信息
export function useId() {
    var [ id , setId ] = useState('')
    useEffect(() => {
        //-----🍌---🍌---🍌-----
        setId(JSON.parse( localStorage.getItem('userinfo') ).name)
     },[])
     return [ id , setId ];
}

// callectshopping
export function useCallectshopping() {
    var [ data , setData ] = useState([]);
    useEffect(() => {
       //-----🍌---🍌---🍌-----
       callect_shopping().then(
            response => {
                //  console.log( response.data ) 
                 setData(response.data)
            }
       )
    },[])
    return [ data , setData ];
}